![]() |
PBCatSearchSync |
||||
Header: | Files.h | Carbon status: | Supported | |
Searches a volume’s catalog file using a set of search criteria that you specify. It builds a list of all files or directories that meet your specifications.
OSErr PBCatSearchSync ( CSParamPtr paramBlock );
A pointer to a csParam variant of an HFS parameter block.
A result code.
The relevant fields of the parameter block are:
On input, a pointer to a completion function.
On output, the result code of the function.
On input, a pointer to a pathname.
On input, a volume specification for the volume to search.
On input, a pointer to an array of matches. On return, a pointer to an array of FSSpec structures identifying the files and directories that match the criteria.
On input, the maximum match count.
On output, the actual match count.
On input, enable bits for fields in criteria structures.
On input, the values and lower bounds.
On input, the masks and upper bounds.
On input, the maximum allowed search time.
The current catalog position.
On input, a pointer to optional read buffer.
On input, the length of optional read buffer.
The PBCatSearchSync function searches the volume you specify for files or directories that match two coordinated sets of selection criteria.
If the catalog file changes between two timed calls to PBCatSearchSync (that is, when you are using ioSearchTime and ioCatPosition to search a volume in segments and the catalog file changes between searches), PBCatSearchSync returns a result code of catChangedErr and no matches. Depending on what has changed on the volume, ioCatPosition might be invalid, most likely by a few entries in one direction or another. You can continue the search, but you risk either skipping some entries or reading some twice.
When PBCatSearchSync has searched the entire volume, it returns eofErr. If it exits because it either spends the maximum time allowed by ioSearchTime or finds the maximum number of matches allowed by ioReqMatchCount, it returns noErr. You can specify a value of 0 in the ioSearchTime field to indicate that no time limit is to be enforced.
Not all volumes support the PBCatSearchSync function. Before you call PBCatSearchSync to search a particular volume, you should call the PBHGetVolParmsSync function to determine whether that volume supports PBCatSearchSync.
Even though AFP volumes support PBCatSearchSync, they do not support all of its features that are available on local volumes. These restrictions apply to AFP volumes:
Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.
© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)